<?php
require_once( dirname(__FILE__).'/../libs/bedmintonlib.php' );

$emailStr = "Email";
$passwordStr = "Heslo";
$loginStr = "Prihlásiť";
$enterValidEmail = "Zadajte platnú mailovú adresu";
$emailAddressUsed = "Zadaná mailovú adresu už používa iný používateľ";
$newUser = "Nový používateľ";
$forgottenPassword = "Zabudol som heslo";
$changePassword = "Zmena hesla";

if (isEnglish())
{
    $emailStr = "Email";
    $passwordStr = "Password";
    $loginStr = "Login";
    $enterValidEmail = "Please enter a valid email address";
    $emailAddressUsed = "Email address is used by another user";
    $newUser = "New user";
    $forgottenPassword = "I forgot my password";
    $changePassword = "Change my password";
}

$scriptStr = "
<script type=\"text/javascript\">
$(document).ready(function() {
	var validator = $(\"#loginform\").validate({
		rules: {
			email: {
				required: true,
				email: true,
			}
		},
		messages: {
			email: {
				required: \"$enterValidEmail\",
				email: \"$enterValidEmail\",
			}
		}
	});

});
</script>
";

$formStr = "
<form id=\"loginform\" method=\"post\" action=\"applogic/acceptlogin.php\">
<table class=\"formCentered\">
<tr>
<td class=\"label\"><label id=\"lemailaddress\" for=\"emailaddress\">$emailStr</label></td>
<td class=\"field\"><input id=\"login\" name=\"login\" type=\"text\" value=\"\" maxlength=\"150\" ></td>
</tr>
<tr>
<td class=\"label\"><label id=\"lpassword\" for=\"password\">$passwordStr</label></td>
<td class=\"field\"><input id=\"password\" name=\"password\" type=\"password\" maxlength=\"50\" value=\"\" ></td>
</tr>


<tr>
<td></td>
<td><input type=\"submit\" name=\"newname\" value=\"$loginStr\" ></td>
</tr>
</table>

</form>

<table class=\"formLinksCentered\"><tr><td>
<a href = \"index.php?siteName=mainsites/registration.php\">$newUser</a>
<a href = \"index.php?siteName=mainsites/forgottenpassword.php\">$forgottenPassword</a>
<a href = \"index.php?siteName=mainsites/changepasswordform.php\">$changePassword</a>
</td></tr></table>
";



$howToRegisterTitle = "Registrácia";
$howToRegisterIntro = "Registrácia funguje tak, že kliknete na odkaz <b>\"Nový používateľ.\"</b>
                       Po vyplnení daného formulára a následného potvrdenia obdržíte mail. <b>Kliknutím na odkaz</b>,
                       ktorý je uvedený v maile sa Vaša požiadavka o registráciu potvrdí a Vy sa môžete prihlásiť.";
$howToRegisterDescription = "Po prihlásení možete vykonávať rezevácie. <b>Odhlásiť sa </b>môžete po každom prihlásení na dolnej lište, 
                                kde je uvedené aj to, kto je momentálne prihlásený.";
$howToReserveDescription = "Ak si chcete rezervovať termín, tak po prihlásení kliknite na požadovaný deň v kalendári na stránke <b>Rezervácii</b> 
                       a následne kliknite na príslušný kurt a hodinu. Následne túto operáciu potvrďte kliknutím na tlačidlo
                       <b>Potvrdiť</b>. Vaše rezervácie je možné cez web aj zrušiť, kliknutím na rezervácie označené písmenom <b>M</b>(Moje).
                       Zrušiť rezerváciu cez web však nie je možné menej ako 24 hodín pred termínom jej uplatnenia. Ak je to z rôznych 
                       dôvodov nutné vykonať, kontakujte nás na telefónnom čísle <b>+421 918 999 888</b>. Na tomto čísle je možné aj naďalej 
                       vykonávať rezervácie. Na stránke <b>Rezervácii</b> vidíte voľné termíny pre daný deň.";

if (isEnglish())
{  
    $howToRegisterTitle = "Registration";
    $howToRegisterIntro = "If you want to register, you have to click on <b>Login.</b> Then click on the link 
                           <b>\"New User\".</b> After completing and confirming the form, you will receive an e-mail. 
                           <b>By clicking on the link </b> which is attached in the mail, your request for registration 
                           will be confirmed and you can log in.";
    $howToRegisterDescription = "After logging in you can manage your reservations. After logging in, you can <b>log out</b> 
                                on the bottom of the site, where is also shown, who is loged in.";
        $howToReserveDescription = "If you want to reserve some terms, you have to select required day in calendar on the 
                       <b>Reservations</b> web page. Then you have to select court and hour. You have to confirm your reservation
                        by clicking on the <b>Confirm</b> button. You can also cancel your reservations through the web. Your reservations
                        are marked with <b>M</b>(My). Canceling through the web is possible more than 24 hours before the term.
                        When you have to cancel your reservation less than 24 hours before the term, you have to do it on the
                        phone number <b>+421 918 999 888</b>. You can also make your reservation on this phone number, when you don't
                        want to do it through the web. On the web page <b>Resevrations</b> you can see all free terms for the selected day.";
    
}
 echo( $scriptStr );
 echo( $formStr );
 echo( " <br><br><span class=\"titleInTab\">$howToRegisterTitle</span><br><br>
        <div class=\"howToRegisterDescription\"> $howToRegisterIntro</div>
        <div class=\"howToRegisterDescription\">$howToRegisterDescription</div>
        <div class=\"howToRegisterDescription\">$howToReserveDescription</div><br>
       " );
?>
